{extend name="$base" /} 
{block name="resources"}
<link rel="stylesheet" type="text/css" href="WAP_CSS/distribution_commission_shop.css">
{/block}
{block name="head_operation"}<a class="ns-operation" href="{:__URL('APP_MAIN/member/salaryWithdrawList')}">提现明细</a>{/block}
{block name="main"}
{php}
	// 会员账户信息
	$member_account = api("System.Member.memberAccount");
	$member_account = $member_account['data'];

	// 累计佣金
	$member_all_salary = api("System.Member.memberAllSalary");
	$member_all_salary = $member_all_salary['data'];

	//待审核金额
	$member_withdraw_account = api("System.Member.withdrawAccount");
	$member_withdraw_account = $member_withdraw_account['data'];
{/php}
<div class="distribution-commission-shop">
	<div class="tip-head">
		<p class="tip-txt"><i class="icon-money"></i>可提现</p>
		<span class="commission-cash">¥{$member_account['salary']}</span>

		<a href="{:__URL('APP_MAIN/member/toWithdraw')}" class="standard-btn">申请提现</a>

	</div>
	<div class="tip-bottom">
		<p class="field-2 pull-left">累计佣金<br/><span>￥{$member_all_salary}</span></p>
		<p class="field-2 pull-left">待审核金额<br/><span>￥{$member_withdraw_account['un_account']}</span></p>
		<p class="field-2 pull-right">已提现<br/><span>￥{$member_withdraw_account['al_account']}</span></p>
	</div>
	<div id="mescroll" class="mescroll" style="top: 260px;">
		<ul class="list-content">
		</ul>
	</div>
</div>


{/block}
{block name="footer"}{/block}
{block name="script"}
<script type="text/javascript">
	$(function(){
		mescroll = new ScrollList("mescroll", query_detail);
	});

	function query_detail(page_index, is_append)
	{
		var params = {page_index: page_index,account_type:1};
		var html = "";
		api("System.Member.salaryList", params, function (res) {
			console.log(res)
			var list = res.data;
			if (list.data.length > 0) {
				$(list.data).each(function (i, v) {
					html += '<div class="list-content-wrapper">';
					html += '<div class="list-content-wrapper-top">';
					html += '<div class="list-content-wrapper-top-left text16">' + v.category_name + '</div>';
					html += '<div class="list-content-wrapper-top-right ns-text-color" >' + v.total_money + '</div>';
					html += '</div>';
					html += '<div class="list-content-wrapper-bottom">';
					html += '<div class="list-content-wrapper-bottom-left ns-text-color-gray">' + v.remark + '</div>';
					html += '<div class="list-content-wrapper-bottom-right ns-text-color-gray">' + timeStampTurnTime(v.add_time) + '</div>';
					html += '</div>';
					html += '</div>';
					html += '<div class="line"></div>';
				});
			} else {
				html += '<div class="list-empty-wrapper">';
				html += '<div>';
				html += '<div class="list-empty-img">';
				html += '<img src="' + WAPIMG + '/wap_nodata.png">';
				html += '</div>';
				html += '<div class="list-empty-text">';
				html += '暂无数据';
				html += '</div>';
				html += '</div>';
				html += '</div>';
			}

			if (is_append) $("#mescroll ul").append(html);
			else $("#mescroll ul").html(html);
			mescroll.endByPage(list.total_count, list.page_count);
		});
	}
</script>
{/block}